package org.langcom.logic;

import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public abstract class AbstractCompositeLogic extends AbstractLogic implements ICompositeLogic {

	protected final List<ILogic> children = new LinkedList<ILogic>();

	protected AbstractCompositeLogic(String description, String detailedDescription) {
		super(description, detailedDescription);
	}

	public ICompositeLogic add(ILogic... logic) {
		List<ILogic> list = Arrays.asList(logic);
		children.addAll(list);
		return this;
	}

	public List<ILogic> getChildren() {
		return Collections.unmodifiableList(children);
	}
}
